package leetcode.list;

/**
 * @author mazouri
 * @create 2021-08-18 23:42
 */
public class _206_reverseList {
    public ListNode reverseList(ListNode head) {
        ListNode pre = null;
        ListNode next = null;
        while (head != null) {
            next = head.next;
            head.next = pre;
            pre = head;
            head = next;
        }
        return pre;
    }
}
